home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.541 < prev    next >
Encoding:
Text File  |  1996-02-12  |  27.6 KB  |  842 lines

  1. Frequently Asked Questions (FAQS);faqs.541
  2.  
  3.  
  4.  
  5. Archive-name: unix-faq/shell/csh-whynot
  6. Version: $Id: csh-faq,v 1.2 92/11/30 05:26:37 tchrist Exp Locker: tchrist $
  7.  
  8. The following periodic article answers in excruciating detail
  9. the frequently asked question "Why shouldn't I program in csh?".
  10. It is available for anon FTP from convex.com in /pub/csh.whynot .
  11.  
  12.  
  13.            Csh Programming Considered Harmful
  14.  
  15. Resolved: The csh is a tool utterly inadequate for programming, and
  16. its use for such purposes should be strictly banned.
  17.  
  18. I am continually shocked and dismayed to see people write test cases,
  19. install scripts, and other random hackery using the csh.  Lack of
  20. proficiency in the Bourne shell has been known to cause errors in /etc/rc
  21. and .cronrc files, which is a problem, because you *must* write these files
  22. in that language.
  23.  
  24. The csh is seductive because the conditionals are more C-like, so the path
  25. of least resistance if chosen and a csh script is written.  Sadly, this is
  26. a lost cause, and the programmer seldom even realizes it, even when they
  27. find that many simple things they wish to do range from cumbersome to
  28. impossible in the csh.
  29.  
  30.  
  31. FILE DESCRIPTORS
  32.  
  33. The most common problem encountered in csh programming is that
  34. you can't do file-descriptor manipulation.  All you are able to
  35. do is redirect stdin, or stdout, or dup stderr into stdout.
  36. Bourne-compatible shells offer you an abundance of more exotic
  37. possibilities.
  38.  
  39. Writing Files
  40.  
  41. In the Bourne shell, you can open or dup random file descriptors.
  42. For example,
  43.  
  44.     exec 2>errs.out
  45.  
  46. means that from then on, stderr goes into errs file.
  47.  
  48. Or what if you just want to throw away stderr and leave stdout
  49. alone?    Pretty simple operation, eh?
  50.  
  51.     cmd 2>/dev/null
  52.  
  53. Works in the Bourne shell.  In the csh, you can only make a pitiful
  54. attempt like this:
  55.  
  56.     (cmd > /dev/tty) >& /dev/null
  57.  
  58. But who said that stdout was my tty?  So it's wrong.  This simple
  59. operation *CANNOT BE DONE* in the csh.
  60.  
  61.  
  62. Along these same lines, you can't direct error messages in csh
  63. scripts out stderr as is considered proper.  In Bourne shell, you
  64. might say:
  65.  
  66.     echo "$0: cannot find $file" 1>&2
  67.  
  68. but in the csh, you can't redirect stdout out stderr, so you end
  69. up doing something silly like this:
  70.  
  71.     sh -c 'echo "$0: cannot find $file" 1>&2'
  72.  
  73. Reading Files
  74.  
  75. In the csh, all you've got is $<, which reads a line from your tty.  What
  76. if you've redirected stdin?  Tough noogies, you still get your tty, which
  77. you really can't redirect.  Now, the read statement
  78. in the Bourne shell allows you to read from stdin, which catches
  79. redirection.  It also means that you can do things like this:
  80.  
  81.     exec 3<file1
  82.     exec 4<file2
  83.  
  84. Now you can read from fd 3 and get lines from file1, or from file2 through
  85. fd 4.   In modern, Bourne-like shells, this suffices:
  86.  
  87.     read some_var 0<&3
  88.     read another_var 0<&4
  89.  
  90. Although in older ones where read only goes from 0, you trick it:
  91.  
  92.     exec 5<&0  # save old stdin
  93.     exec 0<&3; read some_var
  94.     exec 0<&4; read another_var
  95.     exec 0<&5  # restore it
  96.  
  97.  
  98. Closing FDs
  99.  
  100. In the Bourne shell, you can close file descriptors you don't
  101. want open, like 2>&-, which isn't the same as redirecting it
  102. to /dev/null.
  103.  
  104. More Elaborate Combinations
  105.  
  106. Maybe you want to pipe stderr to a command and leave stdout alone.
  107. Not too hard an idea, right?  You can't do this in the csh as I
  108. mentioned in 1a.  In a Bourne shell, you can do things like this:
  109.  
  110.     exec 3>&1; grep yyy xxx 2>&1 1>&3 3>&- | sed s/file/foobar/ 1>&2 3>&-
  111.     grep: xxx: No such foobar or directory
  112.  
  113. Normal output would be unaffected.  The closes there were in case
  114. something really cared about all its FDs.  We send stderr to sed,
  115. and then put it back out 2.
  116.  
  117. Consider the pipeline:
  118.  
  119.     A | B | C
  120.  
  121. You want to know the status of C, well, that's easy: it's in $?, or
  122. $status in csh.  But if you want it from A, you're out of luck -- if
  123. you're in the csh, that is.  In the Bourne shell, you can get it, although
  124. doing so is a bit tricky.  Here's something I had to do where I ran dd's
  125. stderr into a grep -v pipe to get rid of the records in/out noise, but had
  126. to return the dd's exit status, not the grep's:
  127.  
  128.     device=/dev/rmt8
  129.     dd_noise='^[0-9]+\+[0-9]+ records (in|out)$'
  130.     exec 3>&1
  131.     status=`((dd if=$device ibs=64k 2>&1 1>&3 3>&- 4>&-; echo $? >&4) |
  132.         egrep -v "$dd_noise" 1>&2 3>&- 4>&-) 4>&1`
  133.     exit $status;
  134.  
  135.  
  136.  
  137. COMMAND ORTHOGONALITY
  138.  
  139. Built-ins
  140.  
  141. The csh is a horrid botch with its built-ins.  You can't put them
  142. together in many reasonable way.   Even simple little things like this:    
  143.  
  144.         % time | echo
  145.  
  146. which while nonsensical, shouldn't give me this message:
  147.  
  148.         Reset tty pgrp from 9341 to 26678
  149.  
  150. Others are more fun:
  151.  
  152.         % sleep 1 | while
  153.         while: Too few arguments.
  154.         [5] 9402
  155.         % jobs
  156.         [5]     9402 Done                 sleep |
  157.  
  158.  
  159. Some can even hang your shell.  Try typing ^Z while you're sourcing
  160. something, or redirecting a source command.  Just make sure you have
  161. another window handy.  Or try
  162.  
  163.     % history | more
  164.  
  165. on some systems.
  166.  
  167. Flow control
  168.  
  169. You can't mix flow-control and commands, like this:
  170.  
  171.     who | while read line; do
  172.     echo "gotta $line"
  173.     done
  174.  
  175.  
  176. You can't combine multiline constructs in a csh using semicolons.
  177. There's no easy way to do this
  178.  
  179.     alias cmd 'if (foo) then bar; else snark; endif'
  180.  
  181.  
  182.  
  183.  
  184. Stupid parsing bugs
  185.  
  186. Certain reasonable things just don't work, like this:
  187.  
  188.     % kill -1 `cat foo`
  189.     `cat foo`: Ambiguous.
  190.  
  191. But this is ok:
  192.  
  193.     % /bin/kill -1 `cat foo`
  194.  
  195. If you have a stopped job:
  196.  
  197.     [2]     Stopped              rlogin globhost
  198.  
  199. You should be able to kill it with
  200.  
  201.     % kill %?glob
  202.     kill: No match
  203.  
  204. but
  205.  
  206.     % fg %?glob
  207.  
  208. works.
  209.  
  210. White space can matter:
  211.  
  212.     if(expr)
  213.  
  214. may fail on some versions of csh, while
  215.  
  216.     if (expr)
  217.  
  218. works!
  219.  
  220.  
  221.  
  222. SIGNALS
  223.  
  224. In the csh, all you can do with signals is trap SIGINT.  In the Bourne
  225. shell, you can trap any signal, or the end-of-program exit.    For example,
  226. to blow away a tempfile on any of a variety of signals:
  227.  
  228.     $ trap 'rm -f /usr/adm/tmp/i$$ ;
  229.         echo "ERROR: abnormal exit";
  230.         exit' 1 2 3 15
  231.  
  232.     $ trap 'rm tmp.$$' 0   # on program exit
  233.  
  234.  
  235.  
  236. 6.  QUOTING
  237.  
  238. You can't quote things reasonably in the csh:
  239.  
  240.     set foo = "Bill asked, \"How's tricks?\""
  241.  
  242. doesn't work.  This makes it really hard to construct strings with
  243. mixed quotes in them.  In the Bourne shell, this works just fine.
  244. In fact, so does this:
  245.  
  246.      cd /mnt; /usr/ucb/finger -m -s `ls \`u\``
  247.  
  248. Dollar signs cannot be escaped in double quotes in the csh.  Ug.
  249.  
  250.     set foo = "this is a \$dollar quoted and this is $HOME not quoted"
  251.     dollar: Undefined variable.
  252.  
  253. You have to use backslashes for newlines, and it's just darn hard to
  254. get them into strings sometimes.
  255.  
  256.     set foo = "this \
  257.     and that";
  258.     echo $foo
  259.     this  and that
  260.     echo "$foo"
  261.     Unmatched ".
  262.  
  263. Say what?  You don't have these problems in the Bourne shell, where it's
  264. just fine to write things like this:
  265.  
  266.     echo     'This is
  267.          some text that contains
  268.          several newlines.'
  269.  
  270.  
  271. As distributed, quoting history references is a challenge.  Consider:
  272.  
  273.     % mail adec23!alberta!pixel.Convex.COM!tchrist
  274.     alberta!pixel.Convex.COM!tchri: Event not found.
  275.  
  276.  
  277. VARIABLE SYNTAX
  278.  
  279. There's this big difference between global (environment) and local
  280. (shell) variables.  In csh, you use a totally different syntax
  281. to set one from the other.
  282.  
  283. In Bourne shell, this
  284.     VAR=foo cmds args
  285.  is the same as
  286.     (export VAR; VAR=foo; cmd args)
  287. or csh's
  288.     (setenv VAR;  cmd args)
  289.  
  290. You can't use :t, :h, etc on envariables.  Watch:
  291.     echo Try testing with $SHELL:t
  292.  
  293. It's really nice to be able to say
  294.  
  295.     ${PAGER-more}
  296. or
  297.     FOO=${BAR:-${BAZ}}
  298.  
  299. to be able to run the user's PAGER if set, and more otherwise.
  300. You can't do this in the csh.  It takes more verbiage.
  301.  
  302. You can't get the process number of the last background command from the
  303. csh, something you might like to do if you're starting up several jobs in
  304. the background.  In the Bourne shell, the pid of the last command put in
  305. the background is available in $!.
  306.  
  307. The csh is also flaky about what it does when it imports an
  308. environment variable into a local shell variable, as it does
  309. with HOME, USER, PATH, and TERM.  Consider this:
  310.  
  311.     % setenv TERM '`/bin/ls -l / > /dev/tty`'
  312.     % csh -f
  313.  
  314. And watch the fun!
  315.  
  316.  
  317. EXPRESSION EVALUATION
  318.  
  319. Consider this statement in the csh:
  320.  
  321.  
  322.     if ($?MANPAGER) setenv PAGER $MANPAGER
  323.  
  324.  
  325. Despite your attempts to only set PAGER when you want
  326. to, the csh aborts:
  327.  
  328.     MANPAGER: Undefined variable.
  329.  
  330. That's because it parses the whole line anyway AND EVALUATES IT!
  331. You have to write this:
  332.  
  333.     if ($?MANPAGER) then
  334.     setenv PAGER $MANPAGER
  335.     endif
  336.  
  337. That's the same problem you have here:
  338.  
  339.     if ($?X && $X == 'foo') echo ok
  340.     X: Undefined variable
  341.  
  342. This forces you to write a couple nested if statements.  This is highly
  343. undesirable because it renders short-circuit booleans useless in
  344. situations like these.  If the csh were the really C-like, you would
  345. expect to be able to safely employ this kind of logic.  Consider the
  346. common C construct:
  347.  
  348.     if (p && p->member)
  349.  
  350. Undefined variables are not fatal errors in the Bourne shell, so
  351. this issue does not arise there.
  352.  
  353. While the csh does have built-in expression handling, it's not
  354. what you might think.  In fact, it's space sensitive.  This is an
  355. error
  356.  
  357.    @ a = 4/2
  358.  
  359. but this is ok
  360.  
  361.    @ a = 4 / 2
  362.  
  363.  
  364. The ad hoc parsing csh employs fouls you up in other places
  365. as well.  Consider:
  366.  
  367.     % alias foo 'echo hi' ; foo
  368.     foo: Command not found.
  369.     % foo
  370.     hi
  371.  
  372.  
  373. ERROR HANDLING
  374.  
  375. Wouldn't it be nice to know you had an error in your script before
  376. you ran it?   That's what the -n flag is for: just check the syntax.
  377. This is especially good to make sure seldom taken segments of code
  378. code are correct.  Alas, the csh implementation of this doesn't work.
  379. Consider this statement:
  380.  
  381.     exit (i)
  382.  
  383. Of course, they really meant
  384.  
  385.     exit (1)
  386.  
  387. or just
  388.  
  389.     exit 1
  390.  
  391. Either shell will complain about this.  But if you hide this in an if
  392. clause, like so:
  393.  
  394.     #!/bin/csh -fn
  395.     if (1) then
  396.     exit (i)
  397.     endif
  398.  
  399. The csh tells you there's nothing wrong with this script.  The equivalent
  400. construct in the Bourne shell, on the other hand, tells you this:
  401.  
  402.  
  403.     #!/bin/sh -n
  404.     if (1) then
  405.     exit (i)
  406.     endif
  407.  
  408.     /tmp/x: syntax error at line 3: `(' unexpected
  409.  
  410.  
  411.  
  412. RANDOM BUGS
  413.  
  414. Here's one:
  415.  
  416.     fg %?string
  417.     ^Z
  418.     kill  %?string
  419.     No match.
  420.  
  421. Huh? Here's another
  422.  
  423.     !%s%x%s
  424.  
  425. Coredump, or garbage.
  426.  
  427. If you have an alias with backquotes, and use that in backquotes in
  428. another one, you get a coredump.
  429.  
  430. Try this:
  431.     % repeat 3 echo "/vmu*"
  432.     /vmu*
  433.     /vmunix
  434.     /vmunix
  435. What???
  436.  
  437.  
  438. Here's another one:
  439.  
  440.     % mkdir tst
  441.     % cd tst
  442.     % touch '[foo]bar'
  443.     % foreach var ( * )
  444.     > echo "File named $var"
  445.     > end
  446.     foreach: No match.
  447.  
  448.  
  449. SUMMARY
  450.  
  451.  
  452. While some vendors have fixed some of the csh's bugs (the tcsh also does
  453. much better here), many have added new ones.  Most of its problems can
  454. never be solved because they're not actually bugs per se, but rather the
  455. direct consequences of braindead design decisions.  It's inherently flawed.
  456.  
  457. Do yourself a favor, and if you *have* to write a shell script, do it in the
  458. Bourne shell.  It's on every UNIX system out there.  However, behavior
  459. can vary.
  460.  
  461. There are other possibilities.
  462.  
  463. The Korn shell is the preferred programming shell by many sh addicts,
  464. but it still suffers from inherent problems in the Bourne shell's design,
  465. such as parsing and evaluation horrors.  The Korn shell or its
  466. public-domain clones and supersets (like bash) aren't quite so ubiquitous
  467. as sh, so it probably wouldn't be wise to write a sharchive in them that
  468. you post to the net.  When 1003.2 becomes a real standard that companies
  469. are forced to adhere to, then we'll be in much better shape.  Until
  470. then, we'll be stuck with bug-incompatible versions of the sh lying about.
  471.  
  472. The Plan 9 shell, rc, is much cleaner in its parsing and evaluation; it is
  473. not widely available, so you'd be sacrificing portability.  No vendor
  474. is shipping it yet.
  475.  
  476. If you don't have to use a shell, but just want an interpreted language,
  477. many other free possibilities present themselves, like Perl, REXX, TCL,
  478. Scheme, or Python.  Of these, Perl is probably the most widely available
  479. on UNIX (and many other) systems and certainly comes with the most
  480. extensive UNIX interface.  Some vendors even ship it standard.
  481.  
  482. If you have a problem that would ordinarily use sed or awk or sh, but it
  483. exceeds their capabilities or must run a little faster, and you don't want
  484. to write the silly thing in C, then Perl may be for you.  You can get
  485. at networking functions, binary data, and most ofthe C library. There
  486. are also translators to turn your sed and awk scripts into Perl scripts,
  487. as well as a symbolic debugger.  Tchrist's personal rule of thumb is
  488. that if it's the size that fits in a Makefile, it gets written in the
  489. Bourne shell, but anything bigger gets written in Perl.
  490.  
  491. See the comp.lang.{perl,rexx,tcl} newsgroups for details about these
  492. languages (including FAQs), or David Muir Sharnoff's comparison of
  493. freely available languages and tools in comp.lang.misc and news.answers.
  494.  
  495.  
  496. --
  497.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  498.  
  499.     "UNIX was not designed to stop you from doing stupid things, because
  500.      that would also stop you from doing clever things." -- Doug Gwyn
  501. Xref: bloom-picayune.mit.edu comp.unix.shell:8334 news.answers:4768
  502. Path: bloom-picayune.mit.edu!senator-bedfellow.mit.edu!senator-bedfellow.mit.edu!usenet
  503. From: tmatimar@empress.com (Ted M A Timar)
  504. Newsgroups: comp.unix.shell,news.answers
  505. Subject: Changes to "Welcome to comp.unix.shell" [Frequent posting]
  506. Supersedes: <unix-faq/shell/diff_723967331@athena.mit.edu>
  507. Followup-To: comp.unix.questions
  508. Date: 24 Dec 1992 06:02:21 GMT
  509. Organization: Empress Software
  510. Lines: 29
  511. Approved: news-answers-request@MIT.Edu
  512. Distribution: world
  513. Expires: 21 Jan 1993 06:02:09 GMT
  514. Message-ID: <unix-faq/shell/diff_725176929@athena.mit.edu>
  515. NNTP-Posting-Host: pit-manager.mit.edu
  516. X-Last-Updated: 1992/12/09
  517.  
  518. Archive-name: unix-faq/shell/diff
  519.  
  520. *** /tmp/,RCSt1a18494    Fri Dec  4 07:52:28 1992
  521. --- intro    Fri Dec  4 07:43:02 1992
  522. ***************
  523. *** 2,12 ****
  524.   Newsgroups: comp.unix.shell,news.answers
  525.   Followup-To: comp.unix.shell
  526.   Organization: Empress Software
  527. ! Subject: Welcome to comp.unix.shell [Biweekly posting]
  528.   Approved: news-answers-request@MIT.Edu
  529.  
  530. ! Archive-name: unix-faq/shell-intro
  531. ! Version: $Id: intro,v 2.0 92/10/20 12:08:24 tmatimar Exp $
  532.  
  533.   This article is a monthly attempt to remind potential posters about
  534.   what is appropriate for comp.unix.shell.  If you would like to make
  535. --- 2,12 ----
  536.   Newsgroups: comp.unix.shell,news.answers
  537.   Followup-To: comp.unix.shell
  538.   Organization: Empress Software
  539. ! Subject: Welcome to comp.unix.shell [Frequent posting]
  540.   Approved: news-answers-request@MIT.Edu
  541.  
  542. ! Archive-name: unix-faq/shell/intro
  543. ! Version: $Id: intro,v 2.1 92/12/04 07:48:53 tmatimar Exp $
  544.  
  545.   This article is a monthly attempt to remind potential posters about
  546.   what is appropriate for comp.unix.shell.  If you would like to make
  547. Xref: bloom-picayune.mit.edu comp.unix.shell:8336 news.answers:4771
  548. Path: bloom-picayune.mit.edu!senator-bedfellow.mit.edu!senator-bedfellow.mit.edu!usenet
  549. From: tmatimar@empress.com (Ted M A Timar)
  550. Newsgroups: comp.unix.shell,news.answers
  551. Subject: Welcome to comp.unix.shell [Frequent posting]
  552. Supersedes: <unix-faq/shell/intro_723967331@athena.mit.edu>
  553. Followup-To: comp.unix.shell
  554. Date: 24 Dec 1992 06:02:44 GMT
  555. Organization: Empress Software
  556. Lines: 202
  557. Approved: news-answers-request@MIT.Edu
  558. Distribution: world
  559. Expires: 21 Jan 1993 06:02:09 GMT
  560. Message-ID: <unix-faq/shell/intro_725176929@athena.mit.edu>
  561. NNTP-Posting-Host: pit-manager.mit.edu
  562. X-Last-Updated: 1992/12/09
  563.  
  564. Archive-name: unix-faq/shell/intro
  565. Version: $Id: intro,v 2.1 92/12/04 07:48:53 tmatimar Exp $
  566.  
  567. This article is a monthly attempt to remind potential posters about
  568. what is appropriate for comp.unix.shell.  If you would like to make
  569. any suggestions about the content of this article, please contact
  570. its maintainer at tmatimar@empress.com.
  571.  
  572. Companion articles include the answers to some Frequently
  573. Asked Questions.  You may save yourself a lot of time by reading
  574. those articles before posting a question to the net.
  575.  
  576. If you have not already read the overall Usenet introductory material
  577. posted to "news.announce.newusers", please do.  Much of this article
  578. overlaps with the common sense guidelines posted there.
  579.  
  580.          Should I Post My Shell Question to the Net?
  581.  
  582. Often the answer is "No, you can get an answer a lot faster without
  583. posting a question." Before you post, you should try -
  584.  
  585.     o Reading the manual for your system.  Some day you may encounter
  586.       the phrase "RTFM", which stands for "Read the Fine Manual"
  587.       (except 'F' doesn't really stand for "Fine").  If you ask
  588.       someone a question and they tell you to RTFM, it's an
  589.       indication that you haven't done your homework.  For instance,
  590.       if you are trying to make a script run under csh instead of sh,
  591.       check the man page for "csh".  It might tell you what you need
  592.       to know.
  593.  
  594.       When people use terminology like "read(2)", they are referring
  595.       to the "read" man page in section 2 of the manual (which you
  596.       would see by using "man 2 read").
  597.  
  598.     o Finding a knowledgeable user at your site.  Many sites have
  599.       at least a few shell experts who will be happy to help you
  600.       figure out how to specify that a script should be run by csh.
  601.       Many larger sites, particularly universities, may even have
  602.       paid consultants whose job is to help you with these problems.
  603.       Check with them first.
  604.  
  605.     o Find a good introductory book on Unix shells and shell programming.
  606.       There are plenty of such books available, and you will save yourself
  607.       a lot of trouble by having one handy and consulting it frequently.
  608.       (Question 1.5 in the companion articles will let you know
  609.        where you can find a list of good books.)
  610.  
  611. Please remember that the comp.unix.* newsgroups are read by over 80,000
  612. people around the world, and that posting a question to this group will
  613. cost a lot of time and money by the time your article is distributed to
  614. Asia, Australia, Europe (west and east), Africa, the middle east,
  615. all corners of North, South and Central America and even Antarctica.
  616.  
  617. Also, some people receive these newsgroups as part of a mailing list
  618. rather than a newsgroup.  If you're one of these people, please don't
  619. send a "Remove me from this list" or "UNSUBSCRIBE"  message to the
  620. wrong place.  Take the time to figure out where you're getting this
  621. stuff from, and send your request to the mailing list maintainer, *not*
  622. to the list or newsgroup itself!  Ask your local postmaster for help.
  623. (One of the answers in the companion articles deals with the details of
  624. the mailing list.)
  625.  
  626.                To Which Newsgroup Should I Post My Question?
  627.  
  628. The choice of newsgroup is harder than it used to be.  In the old days,
  629. you just had to choose between "comp.unix.questions" and
  630. "comp.unix.wizards".  Now there are a variety of more specific groups.
  631. This group, "comp.unix.shell" is only for questions relating to any of
  632. the Unix shells and shell programing.  Other groups each have their own
  633. mandates.
  634.  
  635. Choose one of the following groups carefully.  If you aren't sure where
  636. your question belongs or if your question is not specific to some
  637. particular version of Unix, try "comp.unix.questions".  Many
  638. knowledgeable Unix wizards read that group and will be able to help you.
  639.  
  640. Here are the capsule descriptions of various groups you might consider
  641. (extracted from a monthly posting to "news.announce.newusers")
  642.  
  643. comp.unix.shell         Using and programming any UNIX shell.
  644.  
  645. comp.unix.questions     General questions from UNIX users and sysadmins.
  646.             If your question isn't a really good match for one of
  647.             the groups below, post it here.
  648.  
  649. news.answers        Repository for periodic USENET articles. (Moderated)
  650.             This article is crossposted there.
  651.             Do not try to post here unless you're
  652.             posting a list of FAQ's and their answers.
  653.  
  654. comp.lang.c             Discussion about C.
  655.  
  656. comp.sources.unix       Postings of complete, UNIX-oriented sources. (Moderated)
  657. comp.std.unix           Discussion for the P1003 committee on UNIX. (Moderated)
  658. comp.unix               Discussion of UNIX* features and bugs. (Moderated)
  659. comp.unix.admin         Administering a Unix-based system.
  660. comp.unix.aix           IBM's version of UNIX.
  661. comp.unix.amiga        Unix on the Commodore Amiga
  662. comp.unix.aux           The version of UNIX for Apple Macintosh II computers.
  663. comp.unix.bsd           Discussions relating to BSD UNIX.
  664. comp.unix.internals     Discussions on hacking UNIX internals.
  665. comp.unix.large         UNIX on mainframes and in large networks.
  666. comp.unix.misc          Various topics that don't fit other groups.
  667. comp.unix.msdos         MS-DOS running under UNIX by whatever means.
  668. comp.unix.programmer    Q&A for people programming under Unix.
  669. comp.unix.sysv286       UNIX System V (not XENIX) on the '286.
  670. comp.unix.sysv386       Versions of Unix (not Xenix) on Intel 80386-based boxes.
  671. comp.unix.ultrix        Discussions about DEC's Ultrix.
  672. comp.unix.xenix.misc    General discussions regarding XENIX (except SCO).
  673. comp.unix.xenix.sco     XENIX versions from the Santa Cruz Operation.
  674.  
  675. comp.unix.wizards       In-depth discussions of advanced unix topics.
  676.             People should not post to this group unless they
  677.             have used unix as a user, sysadmin and know details
  678.             of the kernel, and how different unix kernels differ.
  679.             In other words, don't post to comp.unix.wizards.
  680.  
  681.           What Information Should I Include?
  682.  
  683. It's hard to include too much information.  There are hundreds of
  684. different systems out there, and they all have less in common
  685. than you might think.  If you have a problem and are posting an
  686. article, please be sure to mention:
  687.  
  688.     o A descriptive subject line.  Many people will decide whether
  689.       to read your article solely on the basis of the subject line,
  690.       so it should be a good statement of your problem.
  691.  
  692.       NOT GOOD                          GOOD
  693.  
  694.       "Help"                            "How do I port csh scripts to ksh?"
  695.       "Csh question"            "csh dumps core when I use '$<'"
  696.  
  697.     o What computer you are using, what specific version of the
  698.       operating system it uses, and to what shell the question
  699.       pertains.  For instance,
  700.  
  701.         SunOS 4.0.1, Sun 3/50, tcsh 6.00.03
  702.         4.3BSD-tahoe, Vax 11/780, rc 1.0
  703.         SVR3.2, 3b2, sh 4.2
  704.  
  705.     o If possible, the *exact* text of any error message you
  706.       may have encountered.
  707.  
  708.       WRONG                RIGHT
  709.  
  710.       "My csh script doesn't run"    "When I type 'scriptname', I get
  711.                       sh: scriptname: This isn't a shell script.
  712.                       What does this mean?  It isn't in
  713.                       the man page.  This is using crash 3.14
  714.                       under Mueslix 9.3 on a Fax 68086502"
  715.  
  716. It's a good idea to post unrelated questions in separate articles,
  717. so that people can keep different discussions separate.   It's also
  718. a *very* good idea to include a line or two like this:
  719.  
  720.     "Please mail your answers to me and I'll summarize what I get
  721.      and post the results to comp.unix.shell."
  722.  
  723. This prevents many identical responses from different users to the
  724. same question from clogging up the newsgroup.  And make sure
  725. you really summarize what you get - don't just concatenate
  726. all the mail you've received.
  727.  
  728. It's also a good idea to read comp.unix.shell for at least a couple
  729. of weeks after you post your article to see what followup articles
  730. are posted.
  731.  
  732.                 Should I Post an Answer to a Question?
  733.  
  734. It's very tempting to post an answer to a question you read on the net,
  735. especially when you think "Aha, finally - a question I can answer!"
  736. Consider though that when a simple question is asked, such as the
  737. sort answered in the companion articles, many other people around the
  738. world already know the answer and may be posting their own reply.
  739. In order to avoid dozens of replies to simple questions, please
  740. wait a day or so and see if anyone else has already answered
  741. the question.  If you have something special to contribute, please
  742. do so, but make sure you're not duplicating something someone else has
  743. already done.
  744.  
  745. You should feel free to reply to any question >by email<.  Even if
  746. the user gets 200 responses to his question, at least the load on the
  747. rest of the net is minimized.
  748.  
  749.                     What About Posting Source Code?
  750.  
  751. Posting small amounts of example code is fine (use comp.sources.unix to
  752. distribute complete programs) - but please make sure that your code
  753. runs (or at least compiles) properly.  Don't just type it in while
  754. editing your posting and hope it will work, no matter how sure you are
  755. that it will.  We all make mistakes.
  756.  
  757.                         What About Those People
  758.        Who Continue to Ask Stupid or Frequently Asked Questions
  759.          In Spite of The Frequently Asked Questions Document?
  760.  
  761. Just send them a polite mail message, possibly referring them to this document.
  762. There is no need to flame them on the net - it's busy enough as it is.
  763. --
  764. Ted Timar - tmatimar@empress.com
  765. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  766. Xref: bloom-picayune.mit.edu comp.unix.questions:51328 news.answers:4769
  767. Path: bloom-picayune.mit.edu!senator-bedfellow.mit.edu!senator-bedfellow.mit.edu!usenet
  768. From: tmatimar@empress.com (Ted M A Timar)
  769. Newsgroups: comp.unix.questions,news.answers
  770. Subject: Changes to "Welcome to comp.unix.questions" [Frequent posting]
  771. Supersedes: <unix-faq/unix/diff_723967331@athena.mit.edu>
  772. Followup-To: comp.unix.questions
  773. Date: 24 Dec 1992 06:02:39 GMT
  774. Organization: Empress Software
  775. Lines: 29
  776. Approved: news-answers-request@MIT.Edu
  777. Distribution: world
  778. Expires: 21 Jan 1993 06:02:09 GMT
  779. Message-ID: <unix-faq/unix/diff_725176929@athena.mit.edu>
  780. NNTP-Posting-Host: pit-manager.mit.edu
  781. X-Last-Updated: 1992/12/09
  782.  
  783. Archive-name: unix-faq/unix/diff
  784.  
  785. *** /tmp/,RCSt1a18541    Fri Dec  4 07:52:42 1992
  786. --- intro    Fri Dec  4 07:42:48 1992
  787. ***************
  788. *** 2,12 ****
  789.   Newsgroups: comp.unix.questions,news.answers
  790.   Followup-To: comp.unix.questions
  791.   Organization: Empress Software
  792. ! Subject: Welcome to comp.unix.questions [Biweekly posting]
  793.   Approved: news-answers-request@MIT.Edu
  794.  
  795. ! Archive-name: unix-faq/unix-intro
  796. ! Version: $Id: intro,v 2.0 92/10/20 12:08:28 tmatimar Exp $
  797.  
  798.   Comp.unix.questions is one of the most popular and highest volume
  799.   newsgroups on Usenet.  This article is a monthly attempt to remind
  800. --- 2,12 ----
  801.   Newsgroups: comp.unix.questions,news.answers
  802.   Followup-To: comp.unix.questions
  803.   Organization: Empress Software
  804. ! Subject: Welcome to comp.unix.questions [Frequent posting]
  805.   Approved: news-answers-request@MIT.Edu
  806.  
  807. ! Archive-name: unix-faq/unix/intro
  808. ! Version: $Id: intro,v 2.1 92/12/04 07:48:37 tmatimar Exp $
  809.  
  810.   Comp.unix.questions is one of the most popular and highest volume
  811.   newsgroups on Usenet.  This article is a monthly attempt to remind
  812. Xref: bloom-picayune.mit.edu comp.unix.questions:51330 news.answers:4772
  813. Path: bloom-picayune.mit.edu!senator-bedfellow.mit.edu!senator-bedfellow.mit.edu!usenet
  814. From: tmatimar@empress.com (Ted M A Timar)
  815. Newsgroups: comp.unix.questions,news.answers
  816. Subject: Welcome to comp.unix.questions [Frequent posting]
  817. Supersedes: <unix-faq/unix/intro_723967331@athena.mit.edu>
  818. Followup-To: comp.unix.questions
  819. Date: 24 Dec 1992 06:02:45 GMT
  820. Organization: Empress Software
  821. Lines: 199
  822. Approved: news-answers-request@MIT.Edu
  823. Distribution: world
  824. Expires: 21 Jan 1993 06:02:09 GMT
  825. Message-ID: <unix-faq/unix/intro_725176929@athena.mit.edu>
  826. NNTP-Posting-Host: pit-manager.mit.edu
  827. X-Last-Updated: 1992/12/09
  828.  
  829. Archive-name: unix-faq/unix/intro
  830. Version: $Id: intro,v 2.1 92/12/04 07:48:37 tmatimar Exp $
  831.  
  832. Comp.unix.questions is one of the most popular and highest volume
  833. newsgroups on Usenet.  This article is a monthly attempt to remind
  834. potential posters about what is appropriate for this newsgroup.
  835. If you would like to make any suggestions about the content of
  836. this article, please contact its maintainer at
  837. tmatimar@empress.com.
  838.  
  839. Companion articles include the answers to some Frequently
  840. Asked Questions.  You may save yourself a lot of time by reading
  841. those articles before posting a question to the net.
  842.